<template>
<div>
  <h1>登录</h1>
  <p>账号<input type="text" v-model="form.mobile"></p>
  <p>密码<input type="text" v-model="form.password"></p>
  <button @click="add">提交</button>
</div>
</template>

<script>
export default {
  name: "cclogin",
  data(){
    return{
      form:{}
    }
  },
  methods:{
    add(){
      this.$axios.post('goods/login',this.form)
      .then(i=>{
        console.log(i.data)
        if (i.data.code ==200){
          localStorage.setItem('userid',i.data.userid)
          alert('登录成功')
          this.$router.push('ccgoods/')
        }
      })
    }
  },
  mounted() {
  }
}
</script>

<style scoped>

</style>
